﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace YYSite.Common.Domain
{
    public interface IEntity<TKey>
    {
        TKey Id { get; set; }

        DateTime CreateTime { get; set; }
    }
    public abstract class EntityBase<TKey>:IEntity<TKey>
    {
        public virtual TKey Id { get; set; }
        public virtual DateTime CreateTime { get; set ; }

        public EntityBase()
        {
            this.CreateTime = DateTime.Now;
        }
    }

    public abstract class EntityBase : EntityBase<Guid>
    {
        public EntityBase():base()
        {
            this.Id = Guid.NewGuid();
        }

        public EntityBase(Guid id):base()
        {
            this.Id = id;
        }
    }
}
